package Ms.controller;

import Result.Result;

import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import Ms.service.ProjectService;

// ProjectController.java
@RestController
@RequestMapping("/admin/projects")
public class ProjectController {
    @Autowired
    ProjectService projectService;

    @SaCheckPermission("project:delete")
    @DeleteMapping("/{projectId}")
    public Result deleteProject(@PathVariable Long projectId) {
        return projectService.deleteProject(projectId) ?
                Result.success() : Result.error("删除失败");
    }
}
